<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>每日任务</title>
    <link rel="stylesheet" href="css/my.css">
    <script type="text/javascript" src="js/jweixin-1.3.2.js"></script>
    <script type="text/javascript" src="js/rem.js"></script>
    <script type="text/javascript" src="js/vue.js"></script>
    <script type="text/javascript" src="js/axios.min.js"></script>
    <!-- 引入样式 -->
    <link rel="stylesheet" href="css/elementui.css">
    <!-- 引入组件库 -->
    <script src="js/elementui.js"></script>
    <style>
     .aaa{
       font-size: 1rem;
     }
    </style>
</head>
<body>
    <div id="app">
      <button @click="aaa" class="aaa">按钮</button>
      <button @click="bbb">跳转</button>
       <a href="">{{a}}</a>
       <el-input v-model="a" placeholder="请输入内容"></el-input>
    </div>
    <script>
      var vm = new Vue({
            el: "#app", //挂载点
            data: {
              a:"1",
              dataFromMiniProgram:""
            },
            methods: { //方法
              getParameterByName(name, url) {
                if (!url) url = window.location.href;
                name = name.replace(/[\[\]]/g, "\\$&");
                var regex = new RegExp("[?&]" + name + "(=([^&#]*)|&|#|$)"),
                results = regex.exec(url);
                if (!results) return null;
                if (!results[2]) return "";
                return decodeURIComponent(results[2].replace(/\+/g, " "));
              },
              aaa() {
                console.log(1111)
               wx.miniProgram.postMessage({ data: { foo: this.dataFromMiniProgram } });
             // wx.miniProgram.redirectTo({
             //   url: '/pages/tabBar/index/index'
             // })
             // wx.miniProgram.navigateTo({url:''})
             // wx.miniProgram.navigateBack({url:''})
             // wx.miniProgram.switchTab({url:''})
             // wx.miniProgram.reLaunch({url:''})
             // wx.miniProgram.redirectTo({url:''})
             },
             bbb(){
                wx.miniProgram.redirectTo({
               url: '/pages/tabBar/index/index'
             })
             }
            },
            watch: { //监听
            
            },
            computed: { //计算属性
              
            },
            filters: { 

            },
            created(){
              this.a  = 2
              this.$message({
                type:"warning",
                message:"111",
                duration:0
              })

            },
            mounted() {
               this.dataFromMiniProgram = this.getParameterByName("mes");
             }
        })

    //     this.$axios({
    //   url:"/api/hotMovie",
    //   method:"post",
    // headers: {
    //     'Content-Type': 'application/json',
    //     'token': 'eyJhbGciOiJIUzI1NiIsInppcCI6IkRFRiJ9.eNqqViotTi3yTFGyUjI2UaoFAAAA__8.A2iYEFWFFmNHn6Nl6wi02xbQoFzyVyz8DSuoq9Hy9Vg'
    // }
    // }).then(d=>{
    //   console.log("----hot-------")
    //   console.log(d)
    //   this.arr=d.data.data
    // })
    </script>
</body>
</html>